package com.stone.design.patterns;

import android.support.test.runner.AndroidJUnit4;

import com.stone.design.patterns.test.FactoryTest;
import com.stone.design.patterns.test.StoneTest;
import com.stone.design.patterns.test.StrategyTest;
import com.stone.design.patterns.test.TestFactory;
import com.stone.design.patterns.test.TestStrategy;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
 * @description
 * @Time 2018/4/2 13:02
 * Created by Stone on 2018/4/2.
 */
@RunWith(AndroidJUnit4.class)
public class AndroidTest {

    @Test
    public void test() {

        /*TestFactory factory = new TestFactory();
        StoneTest factoryTest = factory.createProduct(StrategyTest.class);
        factoryTest.test();*/

        StoneTest stoneTest = new StrategyTest();
        TestStrategy testStrategy = new TestStrategy(stoneTest); // 策略模式测试
        stoneTest = new FactoryTest();
        testStrategy.setStoneTest(stoneTest); // 工厂方法测试
        testStrategy.performTest(); // 执行最后一次测试


    }
}
